﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Menu.aspx.cs" Inherits="WebFormDev.Menu" %>

<%@ Register Assembly="DevExpress.Web.ASPxTreeList.v11.2" Namespace="DevExpress.Web.ASPxTreeList"
    TagPrefix="dx" %>
<%@ Register Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function OpenModule(obj) {
            parent.$("#iframeContent").contents().find("#ASPxPageControl1").addTab({
                text: $(obj).text(),
                url: $(obj).attr("weburl"),
                moduleID: $(obj).attr("moduleid")
            });
            return false;
        }
    </script>
</head>
<body style="margin: 0; padding: 0;">
    <%=treeStyle%>
    <form id="form1" runat="server">
    <dx:ASPxTreeList ID="ASPxTreeList1" runat="server" ParentFieldName="ParentMenu" KeyFieldName="MenuTree"
        Border-BorderStyle="None">
        <Columns>
            <dx:TreeListDataColumn FieldName="ModuleName" Caption="ModuleName" CellStyle-Font-Size="10" CellStyle-Paddings-Padding="0">
                <DataCellTemplate><span style="vertical-align:middle"><img src='images/imgmenu/<%#Eval("ImageIndex") %>.png' height="17" /></span><%# Eval("WebURL").ToString().Length < 5 ? Eval("ModuleName") : "<a onclick='OpenModule(this)' weburl='" + Eval("WebURL") + "' style='text-decoration:underline;cursor:pointer' moduleid='"+Eval("ModuleID")+"'>" + Eval("ModuleName") + "</a>"%></DataCellTemplate>
            </dx:TreeListDataColumn>
        </Columns>
    </dx:ASPxTreeList>
    <a style="text-decoration: underline; cursor: pointer; background-repeat: no-repeat">
    </a>
    </form>
    <script>
        $("tr[id*='ASPxTreeList1_R'],td[class*='dxtlIndentWithButton'],td[class*='dxtlIndent']").css("background-color", "transparent");
    </script>
</body>
</html>
